package com.framework.service.impl;

import com.framework.model.SecurityUserDetail;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

@Service
public class UserDetailsServiceImpl implements UserDetailsService {
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        System.out.println(1111111111);
        return SecurityUserDetail.builder()
                .userId("")
                .username(username)
                .password("$2a$10$HWuOIx8C.YvlhLwp2j5LYe/r8B04xtcFmuu6t1XEBrnr2JLGFcc0q")
                .authorities(AuthorityUtils.createAuthorityList("/name"))
                .build();
    }
}
